<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>客户线索</title>
<link href="<%=path%>/favicon.ico" rel="shortcut icon"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/bc/bootstarp/css/bootstrap.min.css" /> 
<link rel="stylesheet" type="text/css" href="<%=path%>/bc/css/public.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/bc/css/index.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/css/alert.css" />
<style type="text/css">
.s_left_list li a{
	display: inline-block;
	width: 100%;
	height: 100%;
}
</style>
</head>
<body>
<div class="s_popup_delect2">
	<div class="s_consum">
		<p id="dialog_title"></p>
	</div>
</div>
    <ul class="s_header fix">
        <li><img src="<%=path%>/bc/images/logo.png" /></li>
        <shiro:hasPermission name="bc_button">
        <li class="s_header_on"><a href="<%=path%>/api/clue_customer/customerHome">客户</a></li>
        </shiro:hasPermission>
        <shiro:hasPermission name="bm_button">
        <li><a href="javascript:void(0);" class="yingxiao">营销</a></li>
        </shiro:hasPermission>
        <li class="s_quit"><a href="javascript:;">退出系统</a></li>
        <li class="s_set"><a href="${pageContext.request.contextPath}/ui/personalInfor"><img src="<%=path%>/bc/images/icon_set.png" /> 设置</a></li>
        <li class="s_set"><a href="<%=path%>/api/bm/ui/cardHome">酷名片</a></li>     
    </ul>
    <div class="fix">
	    <div class="leftMenu">
	        <ul class="s_left_list fix">
	        	<shiro:hasPermission name="customer_clue_menu">
	            <li class="s_title_on"><a href="<%=path%>/api/clue_customer/allClue" target="iframepage"><img src="<%=path%>/bc/images/clue.png" /> 客户线索</a></li>
	            </shiro:hasPermission>
	            <shiro:hasPermission name="customer_action_menu">
	            <li><a href="<%=path%>/api/customer_action/actionCustomerView" target="iframepage"><img src="<%=path%>/bc/images/action.png" /> 客户行为</a></li>
	            </shiro:hasPermission>
	            <shiro:hasPermission name="customer_info_menu">
	            <li><a href="<%=path%>/api/custome/toCustomerList" target="iframepage"><img src="<%=path%>/bc/images/icon_data.png" /> 客户资料</a></li>
	            </shiro:hasPermission>
	        </ul>
	    </div>
	    <div class="s_content fix">
	    	<iframe id="iframepage" name="iframepage" scrolling="no" frameborder="0" width="100%" src="<%=path%>/api/clue_customer/allClue" onload="changeFrameHeight()"></iframe>
	    </div>
    </div>
</body>
<script type="text/javascript" src="<%=path%>/bc/bootstarp/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.cookie.js"></script>
<script type="text/javascript" src="<%=path%>/js/dialog-plus.js"></script>
<script type="text/javascript" src="<%=path%>/js/exit.js"></script>
<script type="text/javascript">
var auths = "<%=session.getAttribute("authoritys")%>";
$(function(){
	$('.s_left_list li').click(function(){
		
		$.cookie('SaveIndex','0');
		
		var index = $(this).index();
        $(this).addClass('s_title_on').siblings().removeClass();
        if(index == 0){
        	$(document).attr("title","客户线索");
        	$(".s_left_list li:eq(0)>a>img").attr("src","<%=path%>/images/clue.png");
        	$(".s_left_list li:eq(1)>a>img").attr("src","<%=path%>/images/action.png");
        	$(".s_left_list li:eq(2)>a>img").attr("src","<%=path%>/images/icon_data.png");
        	$.cookie('SaveIndex','0');
        }else if(index == 1){
        	$(document).attr("title","客户行为");
        	$(".s_left_list li:eq(0)>a>img").attr("src","<%=path%>/images/icon_clue.png");
        	$(".s_left_list li:eq(1)>a>img").attr("src","<%=path%>/images/icon_action.png");
        	$(".s_left_list li:eq(2)>a>img").attr("src","<%=path%>/images/icon_data.png");
        	$.cookie('SaveIndex','1');
        }else if(index == 2){
        	$(document).attr("title","客户资料");
        	$(".s_left_list li:eq(0)>a>img").attr("src","<%=path%>/images/icon_clue.png");
        	$(".s_left_list li:eq(1)>a>img").attr("src","<%=path%>/images/action.png");
        	$(".s_left_list li:eq(2)>a>img").attr("src","<%=path%>/images/data.png");
        	$.cookie('SaveIndex','2');
        }
    });
});

function changeFrameHeight(){
	var ifm= document.getElementById("iframepage");
	var h = document.documentElement.clientHeight;
    var h2 = $(ifm).contents().height();
    
	if(h2>h){
		h = h2;
	}
	ifm.height = h;
	$(ifm).height(h);
}
window.onresize=function(){
	changeFrameHeight();
}

$(function(){
	if (($.cookie('SaveIndex'))!=null&&($.cookie('SaveIndex'))!="") {
		var index = $.cookie('SaveIndex');
		console.log("获取cookie索引"+index);
		 if(index == 0){
				$(document).attr("title","客户线索");
			 $('.s_left_list>li:eq(0)').addClass('s_title_on').siblings().removeClass();
	        	$(".s_left_list li:eq(0)>a>img").attr("src","<%=path%>/images/clue.png");
	        	$(".s_left_list li:eq(1)>a>img").attr("src","<%=path%>/images/action.png");
	        	$(".s_left_list li:eq(2)>a>img").attr("src","<%=path%>/images/icon_data.png");
	        	$('#iframepage').attr("src","<%=path%>/api/clue_customer/allClue");
	        }else if(index == 1){
	        	$(document).attr("title","客户行为");
	        	 $('.s_left_list>li:eq(1)').addClass('s_title_on').siblings().removeClass();
	        	$(".s_left_list li:eq(0)>a>img").attr("src","<%=path%>/images/icon_clue.png");
	        	$(".s_left_list li:eq(1)>a>img").attr("src","<%=path%>/images/icon_action.png");
	        	$(".s_left_list li:eq(2)>a>img").attr("src","<%=path%>/images/icon_data.png");
	        	$('#iframepage').attr("src","<%=path%>/api/customer_action/actionCustomerView");
	        }else if(index == 2){
	        	$(document).attr("title","客户资料");
	        	 $('.s_left_list>li:eq(2)').addClass('s_title_on').siblings().removeClass();
	        	$(".s_left_list li:eq(0)>a>img").attr("src","<%=path%>/images/icon_clue.png");
	        	$(".s_left_list li:eq(1)>a>img").attr("src","<%=path%>/images/action.png");
	        	$(".s_left_list li:eq(2)>a>img").attr("src","<%=path%>/images/data.png");
	        	$('#iframepage').attr("src","<%=path%>/api/custome/toCustomerList");
	        }
	} else {

	}
})

</script>
</html>